From Scripts to Standardized Open-Source Tools
August 18, 2025
junco as case studyThe pharmaceutical industry faces unique challenges in clinical and statistical programming:
Our solution was to develop our own business logic framework for J&J table creation:
The Junco package provides key features needed for production-ready clinical tables:
Industry Benefits
Creating internal R packages helps pharmaceutical companies: - Maintain consistency across studies and therapeutic areas - Reduce time spent on repetitive coding tasks - Improve compliance with regulatory standards - Facilitate knowledge transfer between team members
Once we had the core functionality working, we needed to focus on:
Documentation is critical for package adoption and proper use:
roxygen2 for function documentation:
#' Calculate risk difference with confidence intervals
#'
#' @param group1 Vector of outcomes for first group
#' @param group2 Vector of outcomes for second group
#' @param conf.level Confidence level (default: 0.95)
#' @return A list with risk difference and confidence intervals
#' @export
risk_diff <- function(group1, group2, conf.level = 0.95) {
# Function implementation
}pkgdown for website generation:
Quality assurance is essential for pharmaceutical applications:
Tip for Pharmaceutical Validation
Include detailed information about validation status and intended use cases to help users understand if the package meets their regulatory requirements.
CI/CD reduces manual work while improving quality:
Managing dependencies is critical for long-term maintenance:
Effective collaboration requires good processes:
Different distribution methods serve different needs:
Pharmaceutical Considerations
Internal packages often contain proprietary methods or company-specific workflows that shouldn’t be publicly shared, while more general statistical methods may benefit from community review through CRAN or GitHub distribution.
Example transformation of repetitive clinical trial analysis scripts:
Contact information: - Email: david.tord@cytel.com - This presentation: https://github.com/munoztd0/R_Package-Dev r icons::icon_style(icons::fontawesome("link"), fill = "white") - GitHub:munoztd0 r icons::icon_style(icons::fontawesome("github"), fill = "white")